import { idText } from "typescript";

export function SearchPanel({
  searchParam,
  setSearchParam,
  personList,
}: {
  searchParam: { keyword: string; personId: string };
  setSearchParam: Function;
  personList: { id: string; name: string }[];
}) {
  return (
    <>
      <input
        type="text"
        value={searchParam.keyword}
        onChange={(e) =>
          setSearchParam({
            ...searchParam,
            keyword: e.target.value,
          })
        }
      ></input>

      <select
        value={searchParam.personId}
        onChange={(e) =>
          setSearchParam({
            ...searchParam,
            personId: e.target.value,
          })
        }
      >
        <option value={""}>负责人</option>
        {personList.map((item: { id: string; name: string }) => (
          <option value={item.id + ""} key={item.id + ""}>
            {item.name}
          </option>
        ))}
      </select>
    </>
  );
}
